/**
 * ipassbook 0.6.0
 * Copyright (C)2009 wateray and contributors
 * wateray@gmail.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package com.wateray.ipassbook.kernel.service;

import java.util.List;

import com.ibatis.dao.client.DaoManager;
import com.wateray.ipassbook.ApplicationConfig;
import com.wateray.ipassbook.domain.Currency;
import com.wateray.ipassbook.persistence.DaoConfig;
import com.wateray.ipassbook.persistence.iface.CurrencyDao;

/**
 * @author wateray
 * @create 2009-5-25
 */
public class CurrencyService {
	private CurrencyDao currencyDao;
	private DaoManager daoMgr;

	public CurrencyService() {
		daoMgr = DaoConfig.getDaoManager();
		this.currencyDao = (CurrencyDao) daoMgr.getDao(CurrencyDao.class);
	}

	public CurrencyService(DaoManager daoMgr, CurrencyDao currencyDao) {
		this.daoMgr = daoMgr;
		this.currencyDao = currencyDao;
	}

	public List<Currency> getCurrencyList() {
		return currencyDao.getCurrencyList(ApplicationConfig.getLang());
	}
	
	public static void main(String[] args) {
		CurrencyService service = new CurrencyService();
		service.getCurrencyList();
	}
}
